﻿class arkadium.EncryptionPlugin
{
	// **MEMBER VARIABLES**
	private var _sEncryptionName:String;
	
	// **FUNCTIONS**
	private function EncryptionPlugin()
	{
	
		_sEncryptionName = "none";
		//m_bScrimNeeded = false;
	}
	
	/**************************************************************************************************\
	registerPanel - Called by the panel who extends this class in order to register itself with the 
	GUIManager for program control.
	\**************************************************************************************************/
	private function registerAlgorithm( pPluginInstance:EncryptionPlugin, sEncryptionName:String )//, pPanelInstance:GUIPanel, pGUIManagerInstance:GUIManager)
	{
		_sEncryptionName = sEncryptionName;	

	}
	
	/**************************************************************************************************\
	onInitialize - Called once by the EncryptionManager when the game is loaded.
	\**************************************************************************************************/
	public function onInitialize()
	{
		
	}
	
	/**************************************************************************************************\
	decrypt - Called by the subclass it is used for parsing an array of encrypted varables
	used most commonly by the appConfigFile.  These bariables are loaded onto the specified object 
	as well as the root, due to a desire for conssistant function
	\**************************************************************************************************/
	public function parseVariables(oDecryptionObject, sParams,sKey )
	{
		var aVars:Array = new Array();
		
		aVars = sParams.split("&");
		for (var count:Number = 0; count <aVars.length ;count++){
			var aVarHolder = new Array();
			aVarHolder = aVars[count].split("=");
			oDecryptionObject[aVarHolder[0]] = aVarHolder[1];
			
			//This function should not be taken advantage of, it is sloppy and saves values to the root,
			//however, since this is the way that the old games did it, we will keep doing this for consistancy
			_level0[aVarHolder[0]] = aVarHolder[1];
			
		}
		oDecryptionObject.params = null;
		
	}
	
	/**************************************************************************************************\
	getPanelName - Returns the name of this panel.
	\**************************************************************************************************/
	public function getEPluginName():String
	{
		return _sEncryptionName;
	}
	

	
	/**************************************************************************************************\
	showPanel - Called by the GUIManager when a panel is requested to be shown.
	\**************************************************************************************************-/
	public function showPanel( pParam:Object )
	{
		trace( "GUIPanel: showPanel() - \"" + m_sPanelName + "\" this should be overwritten." );
	}
	
	/**************************************************************************************************\
	hidePanel - Called by the GUIManager when a panel is requested to be hidden.
	\**************************************************************************************************-/
	public function hidePanel()
	{
		trace( "GUIPanel: hidePanel() - \"" + m_sPanelName + "\" this should be overwritten." );
	}
	*/

	
	
}